package Box2D.Dynamics
{
	import Box2D.Collision.b2Manifold;
	import Box2D.Common.b2Wrapper;
	
	public class b2ContactListener extends b2Wrapper
	{
		public function b2ContactListener()
		{
			super(callDirect('b2ContactListener_new',this));
		}
		public function cBeginContact(contactPtr:Object):void{
			BeginContact(new b2Contact(contactPtr));
		}
		public function cEndContact(contactPtr:Object):void{
			EndContact(new b2Contact(contactPtr));
		}
		public function cPreSolve(contactPtr:Object,oldManifoldPtr:Object):void{
			PreSolve(new b2Contact(contactPtr),new b2Manifold(oldManifoldPtr));
		}
		public function cPostSolve(contactPtr:Object,impulsePtr:Object):void{
			var contact:b2Contact = new b2Contact(contactPtr);
			var impulse:b2ContactImpulse = new b2ContactImpulse(impulsePtr);
			PostSolve(contact,impulse);
		}
		
		public virtual function BeginContact(contact:b2Contact):void { }
		public virtual function EndContact(contact:b2Contact):void { }
		public virtual function PreSolve(contact:b2Contact, oldManifold:b2Manifold):void {}
		public virtual function PostSolve(contact:b2Contact, impulse:b2ContactImpulse):void {}
	}
}